package redis

import (
	"fmt"
	"hello/config"
	"hello/module"
)

func PinJie(c config.RedisConfig) (hasharr []string) {

	for _, v1 := range c.Prefix {
		for _, v2 := range c.Suffix {
			s := fmt.Sprintf("%s%s", v1, v2)
			hasharr = append(hasharr, s)
		}
	}
	return hasharr
	// fmt.Println(c.Prefix)
	// fmt.Println(c.Suffix)
}

func GetCount() {
	RedisConfig := config.InitRedisConfig()
	InitRDB(RedisConfig)
	hasharr := PinJie(RedisConfig)
	for _, v := range hasharr {
		GetHashCount(v)
	}
}

func GetCnafRedis(key string) *module.CnafRedisMetric {
	RedisConfig := config.InitRedisConfig()
	InitRDB(RedisConfig)
	GetHashCount(key)
	return &module.CnafRedisMetric{
		//Tenant:         teant,
		FlightKey:      "1000",
		FlightValue:    1000,
		TaskCacheKey:   "2000",
		TaskCacheValue: 2000,
	}
}
